import request from "@/utils/request"

export const dietaryList = (search) =>
    request({
        url: "/dietaryAll",
        method: "get",
        params: {
            diename: search.diename,
            offset: search.offset,
            limit: search.limit
        }
    })

export const deleteDietary = (id) =>
    request({
        url: "/deleteTaryById" + id,
        method: "delete"
    })

export const addDietary = (dietary) =>
    request({
        url: "/addDietarys",
        method: "post",
        data: dietary
    })

export const updateSeleByid = (id) =>
    request({
        url: "/beforetaryByid" + id,
        method: "post"
    })

export const DieUpdate = (tary) =>
    request({
        url: "/dietaryUpdate",
        method: 'put',
        data: tary
    })

export const selectDietaryNameList = () =>
    request({
        url:'/selectDietaryNameList',
        method:'get'
    })